package com.jgdt.demo.module;
import android.Manifest;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.TextView;
import com.bcia.assetmange.R;
import com.jgdt.demo.core.MultiActivity;
import com.librariy.util.PermHelper;

public class MainActivity extends MultiActivity implements View.OnClickListener{
    private static final String TAG = "LoginActivity";
    private static final String[] permissions=new String[]{Manifest.permission.RECORD_AUDIO};
    private TextView logView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setContentView(R.layout.module_sys_login);
        mViewBinder.getView(R.id.btn_0).setOnClickListener(this);
        mViewBinder.getView(R.id.btn_1).setOnClickListener(this);
        mViewBinder.getView(R.id.btn_2).setOnClickListener(this);
        mViewBinder.getView(R.id.btn_reset).setOnClickListener(this);
        logView = findViewById(R.id.txt_log);
        logView.setMovementMethod(ScrollingMovementMethod.getInstance());
        PermHelper.checkAndRequestPermissions(this,0, permissions);
    }
    @Override
    protected void onStart() {
        super.onStart();
    }
    @Override
    protected void onStop() {
        super.onStop();
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_reset:
                logView.setText("");
                break;
            case R.id.btn_0:
                LocationTools.enableMockLocation(this,117.20000,39.13333);
                break;
            case R.id.btn_1:
                LocationTools.enableMockLocation(this,116.403406,39.912943);
                break;
            case R.id.btn_2:
                LocationTools.disableMockLocation(this);
                break;
            default:
                break;
        }
    }
}
